package com.sangmo.fts;

import com.sangmo.fts.common.CoreFramework;
import com.sangmo.fts.teacher.service.ExaminationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@Configuration
@EnableScheduling
public class ScheduleConfig {

    @Autowired
    private ExaminationService examinationService;

    @Scheduled(fixedRate = 60000*2)
    private void score() {
        System.out.println("自动评分开始！！！！");
        CoreFramework.getInstance().asScheduler();
        examinationService.scoreAuto();
    }
}
